<?php
include('include/config.inc.php');
if(!isset($_SESSION['s_activId'.$cfgPack])
  || (isset($_SESSION['s_userType'.$cfgPack]) && isset($cfgFileNames['dailyreportmaster'][$_SESSION['s_userType'.$cfgPack]]) 
      && $cfgFileNames['dailyreportmaster'][$_SESSION['s_userType'.$cfgPack]] == 0))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{	
  $userId                  = "";
  $userName                = "";
  $currentUserId           = $_SESSION['s_activeUserId'.$cfgPack];
  $selectUser = "SELECT userId,userName
                   FROM user
               ORDER BY userName";
  $selectUserResult = mysql_query($selectUser);
  $a = 0;
  while($userRow = mysql_fetch_array($selectUserResult))
  { 
    $userId[$a]   = $userRow['userId'];
    $userName[$a] = $userRow['userName'];
    $a++;
  } 
  include("./bottom.php");
      $smarty->assign("currentUserId",$currentUserId);
  $smarty->assign("userId",$userId);
  $smarty->assign("userName",$userName);
  $smarty->assign("reportFromDate",date("Y-m-d",strtotime("previous day")));
  //$smarty->assign("reportToDate",date("Y-m-d",strtotime("previous day")));
  $smarty->display("dailyReportList.tpl");
}
?>